﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mimoza.ObjectLayer;
using Mimoza.Apps.Console.Commands;
using Mimoza.Common;

namespace Mimoza.Apps.Console.ViewModel
{
    public class QueryByPlatformViewModel : HostsViewModelBase
    {
        public override void Init(Mimoza.Apps.Console.Application application)
        {
            base.Init(application);

            Application.ContainersTreeViewModel.RegisterContainerTypeViewModel(
                ContainerType.QueryByPlatform, this);
        }

        public override IEnumerable<Mimoza.ObjectLayer.Host> GetHosts()
        {
            ContainerRecord record = new ContainerRecord();
            record.ID = Guid.Empty;
            Container cont = new Container(Application.ObjectLayer, record);

            IEnumerable<Host> hosts = Application.ObjectLayer.ContainerRepository.GetHosts(cont);
            return hosts;
        }
    }
}
